package com.princehan.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author:PrinceHan
 * @CreateTime:2022/4/14 07:43
 */

@Component
// <bean id="user" class="com.princehan.pojo.User"/>
public class User {

    //<property name="name" value="王子"/>
    public String name;
    public Address address;

    @Autowired
    public void setAddress(Address address) {
        this.address = address;
    }

    @Value("王子")
    public void setName(String name) {
        this.name = name;
    }
}
